package com.rc.saas.tenant.service.system;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.rc.saas.tenant.mapper.system.RcAgreementNotificationMapper;
import com.rc.saas.tenant.model.system.RcAgreementNotification;
import com.rc.saas.tenant.search.rc.RcAgreementNotificationSearch;
import com.rc.saas.tenant.vo.tenant.TenantUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RcAgreementNotificationImpl implements RcAgreementNotificationService {
    @Autowired
    private RcAgreementNotificationMapper rcAgreementNotificationMapper;

    @Override
    public RcAgreementNotificationMapper getMapper() {
        return rcAgreementNotificationMapper;
    }

    @Override
    public PageInfo<RcAgreementNotification> listPageContent(String title, Integer pageNo, Integer pageSize) {
        PageHelper.startPage(pageNo, pageSize);
        List<RcAgreementNotification> list = rcAgreementNotificationMapper.listContent(title);
        return new PageInfo<>(list);
    }

    /**
     * 导出数据查询
     * @param rcAgreementNotificationSearch
     * @return
     */
    @Override
    public PageInfo<RcAgreementNotification> listPageContentAll(RcAgreementNotificationSearch rcAgreementNotificationSearch) {
        PageHelper.startPage(rcAgreementNotificationSearch.getOffset(), rcAgreementNotificationSearch.getLimit());
        List<RcAgreementNotification> tenantUserList = rcAgreementNotificationMapper.listContent(rcAgreementNotificationSearch.getTitle());
        return new PageInfo<>(tenantUserList);
    }
}
